package nanocast.apps.creator.modules.mediaWindow.controller
{
	import nanocast.apps.creator.modules.mediaWindow.model.MediaProxy;
	import nanocast.apps.creator.modules.mediaWindow.view.MediaWindowMediator;
	
	import org.osflash.thunderbolt.Logger;
	import org.puremvc.as3.multicore.interfaces.INotification;
	import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
	import org.puremvc.as3.multicore.utilities.assetLoader.clients.flash.URLLoaderClient;
	import org.puremvc.as3.multicore.utilities.assetLoader.model.LoaderProxy;
	
	import uk.co.revisual.puremvc.loader.etypes.ClientTypes;
	
	public class ApplicationStartupCommand extends SimpleCommand
	{
		public static const NAME:String = "org.puremvc.as3.apps.flex.mediaTile.modules.mediaWindow.controller.ApplicationStartupCommand";
		
		override public function execute(notification:INotification):void
		{
			Logger.info(NAME + " : execute()");
			//Model Registrations
			var loaderProxy:LoaderProxy = new LoaderProxy();
			loaderProxy.registerClient(ClientTypes.URLLOADER_CLIENT, URLLoaderClient); 
			facade.registerProxy(loaderProxy);

			facade.registerProxy(new MediaProxy());
			
			//View Registrations
			facade.registerMediator(new MediaWindowMediator(notification.getBody() as MediaWindow));
		} 

	}
}